package org.columba.addressbook.util;

public class Quick extends Recod implements Item 
{ 
    public static Quick a[]=new Quick[9500]; 
	
	public boolean less(Item v) 
     { 
         Quick qu=(Quick)v; 
         switch(flag) 
         { 
             case 2: return id<qu.id; 
             case 1: return name.compareTo(qu.name)<0; 
             default:return balance<qu.balance; 
          } 
      }
	
	public static int getNum(int index)
	{
		return a[index].id;
	}
	
	public static Quick [] getSortedRandomNumList()
	{
		for(int i=0;i<9500;i++) 
        { 
             a[i]=new Quick(); 
             a[i].id=(int)(1+Math.round(Math.random()*75756)); 
             a[i].name="ren"+String.valueOf(i); 
             a[i].balance=10+Math.random()*75756; 
        } 
        SortNumber.quickSort(a,0,9499); 
        return a;
	} 
     
      public static void main(String[]args) 
      { 
             Quick a[]=new Quick[6720]; 
             for(int i=0;i<6720;i++) 
             { 
                  a[i]=new Quick(); 
                  a[i].id=(int)(1+Math.round(Math.random()*75756)); 
                  a[i].name="pinYin"; 
                  a[i].balance=10+Math.random()*75756; 
                 // System.out.println(a[i].id+" "+a[i].balance); 
             } 
             SortNumber.quickSort(a,0,6719); 
             if(flag==2) 
             for(int j=0;j<6720;j++) 
             { 
            	 //System.out.println("htone.put(\""+a[j].id+"\",\""+a[j].name+"\");");
            	 System.out.println("httow.put(\""+a[j].id+"\",\""+a[j].name+"\");");
                 //System.out.println(a[j].id+" "+a[j].name); 
             } 
             else 
             { 
                 for(int j=0;j<9500;j++) 
                 System.out.println(a[j].balance+" "+a[j].name); 
             } 
      } 
}